/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util.piped.pipedStream;

import util.piped.pipedStreamInterFace.Get_SetpipedEventObject;
import util.piped.pipedStreamInterFace.SetpipedEventObject;
import util.piped.pipedStreamInterFace.pipedInObjectListener;
import util.piped.pipedStreamInterFace.GetpipedEventObject;
import util.piped.pipedStreamInterFace.pipedOutObjectListener;
/**
 *
 * @author 梁前武 QQ1587790525
 */
public abstract class abpipedEventObjectLinker implements pipedOutObjectListener,Get_SetpipedEventObject{
    //输入管道，用于将数据转发给接收者
    private pipedInObjectListener inData;
    
    //输出管道，用于接收数据
   // private pipedOutDataListener outData;
    
    public abpipedEventObjectLinker(pipedInObjectListener in){
    this.inData=in;
    }
    
 
    public int OutObject(Object o) {
        //throw new UnsupportedOperationException("Not supported yet.");
        if(inData!=null){
        inData.inObject(o);
        return 0;
        }else{
        return 1;
        }
        
    }

    
    public int open() {
       // throw new UnsupportedOperationException("Not supported yet.");
        
        return 0;
    }

    public int close() {
      //  throw new UnsupportedOperationException("Not supported yet.");
        
        return 0;
    }

    public pipedOutObjectListener getOutpiped() {
       // throw new UnsupportedOperationException("Not supported yet.");
        
        return this;
    }

    public int setInpiped(pipedInObjectListener in) {
       // throw new UnsupportedOperationException("Not supported yet.");
        inData=in;
        return 0;
    }
}
